home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / turbotut.arc / SETS.PAS < prev    next >
Pascal/Delphi Source File  |  1989-06-30  |  2KB  |  50 lines

  1. PROGRAM define_some_sets;
  2.  
  3. TYPE goodies = (ice_cream,whipped_cream,banana,nuts,cherry,
  4.                 choc_syrup,strawberries,caramel,soda_water,
  5.                 salt,pepper,cone,straw,spoon,stick);
  6.  
  7.      treat = SET OF goodies;
  8.  
  9. VAR  sundae         : treat;
  10.      banana_split   : treat;
  11.      soda           : treat;
  12.      ice_cream_cone : treat;
  13.      nutty_buddy    : treat;
  14.      mixed          : treat;
  15.      index          : BYTE;
  16.  
  17. BEGIN
  18.                 (* define all ingredients used in each treat *)
  19. ice_cream_cone := [ice_cream,cone];
  20. soda := [straw,soda_water,ice_cream,cherry];
  21. banana_split := [ice_cream..caramel];
  22. banana_split := banana_split + [spoon];
  23. nutty_buddy := [cone,ice_cream,choc_syrup,nuts];
  24. sundae := [ice_cream,whipped_cream,nuts,cherry,choc_syrup,
  25.            spoon];
  26.  
  27.                  (* combine for a list of all ingredients used *)
  28.  
  29. mixed := ice_cream_cone + soda + banana_split + nutty_buddy +
  30.          sundae;
  31. mixed := [ice_cream..stick] - mixed; (* all ingredients not used *)
  32.  
  33.   IF ice_cream     IN mixed THEN WRITELN('Ice cream not used');
  34.   IF whipped_cream IN mixed THEN WRITELN('Whipped cream not used');
  35.   IF banana        IN mixed THEN WRITELN('Bananas not used');
  36.   IF nuts          IN mixed THEN WRITELN('Nuts are not used');
  37.   IF cherry        IN mixed THEN WRITELN('Cherrys not used');
  38.   IF choc_syrup    IN mixed THEN WRITELN('Chocolate syrup not used');
  39.   IF strawberries  IN mixed THEN WRITELN('Strawberries not used');
  40.   IF caramel       IN mixed THEN WRITELN('Caramel is not used');
  41.   IF soda_water    IN mixed THEN WRITELN('Soda water is not used');
  42.   IF salt          IN mixed THEN WRITELN('Salt not used');
  43.   IF pepper        IN mixed THEN WRITELN('Pepper not used');
  44.   IF cone          IN mixed THEN WRITELN('Cone not used');
  45.   IF straw         IN mixed THEN WRITELN('Straw not used');
  46.   IF spoon         IN mixed THEN WRITELN('Spoon not used');
  47.   IF stick         IN mixed THEN WRITELN('Stick not used');
  48.  
  49. END.
  50.